package com.rayc.mall.api.client;

import com.rayc.mall.api.dto.ItemDTO;
import com.rayc.mall.api.dto.OrderItemDTO;
import com.rayc.mall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Set;

/**
 * @Author: Ray-C
 * @CreateTime: 2025-03-25
 * @Description: item服务远程调用client
 * @Version: 1.0
 */
@FeignClient("mall-item")
public interface ItemClient {
    @GetMapping("/items/list")
    Result<List<ItemDTO>> queryByIds(@RequestParam Set<Long> ids);

    @PostMapping("/items/updateStockAndSold")
    Result<String> updateStockAndSold(List<OrderItemDTO> items);
}
